<%@ Register TagPrefix="uc1" TagName="JSCalendarSetup" Src="../UserControls/JSCalendarSetup.ascx" %>
<%@ Register TagPrefix="uc1" TagName="DateTimePicker" Src="../UserControls/DateTimePicker.ascx" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="MUKDetail.aspx.vb" Inherits="MIMS_WRS.Web.MUKDetail"%>
<%@ Import namespace="MIMS_WRS.Web" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>Order Detail</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<link href="detail.css" type="text/css" rel="stylesheet" name="Default stylesheet">
		<link href="common.css" type="text/css" rel="stylesheet" name="Default stylesheet">
		<script language="javascript" src="../js/common.js"></script>
		<script language="javascript">
var isOnSubmit = false;
var isAlreadyRefresh = false;

var initVarArray;

function form_onsubmit() {	
	ValidatorOnSubmit();
	isOnSubmit = true;
}

function window_onunload() {
	//click "X"?
	if (event.clientY < 0) {
		if (isOnSubmit == false && isAlreadyRefresh == false) {
		<% If RequestContext.Changed = True Then %>
			window.opener.btnRefresh.click();
		<% End If %>
		}
    }
}

function window_onbeforeunload() {
	var isChanged = false;
	if (initVarArray != null) {
		var newVarArray = getFormsElementValue();
		for (i=0; i<newVarArray.length; i++)
			if (newVarArray[i] != initVarArray[i]) {
				isChanged = true;
				break;
			}
	}
	if (isChanged && isOnSubmit == false) {
		event.returnValue = "There are changes on your form.\nAre you sure you want to leave the page?";	
	}	
}

function checkEnterKey() {	
	if (event.keyCode == 13) {
		var btnSubmit = window.document.getElementById('<%= btnSubmit.ClientID %>');
		btnSubmit.click();
		event.returnValue = false;
	}
}

function getFormsElementValue() {
	
	var varArray = new Array();
	var inputCol = window.Form1.getElementsByTagName('input');	
	for (i=0; i<inputCol.length; i++) {
		var type = inputCol[i].type;
		if (type == "text") {
			varArray[varArray.length] = inputCol[i].value;
			inputCol[i].attachEvent("onkeydown", checkEnterKey);					
		}
		if (type == "radio" || type == "checkbox")
			varArray[varArray.length] = inputCol[i].checked;			
	}
	
	var areaCol = window.Form1.getElementsByTagName('area');	
	for (i=0; i<areaCol.length; i++) {
		varArray[varArray.length] = areaCol[i].outerText;		
	}
	
	var selectCol = window.Form1.getElementsByTagName('select');		
	for (i=0; i<selectCol.length; i++) {		
		varArray[varArray.length] = selectCol[i].selectedIndex;		
	}
	
	/*
	var s = "";
	for (i=0; i<varArray.length; i++)
		s += varArray[i] + ',';
	alert(s);
	*/
	return varArray;
}

/*
function conPointOnChange() {
	var txtConPoint = window.document.getElementById('< txtConPoint.ClientID%>');
	var ddlConPoint = window.document.getElementById('< ddlConPoint.ClientID %>');
	if (ddlConPoint.selectedIndex > 0) {
		txtConPoint.style.display = "none";
	}
	else
		txtConPoint.style.display = "";
}


function slOnChange() {
	var divNewSL = window.document.getElementById('divNewSL');
	var ddlSL = window.document.getElementById('< ddlSL.ClientID %>');
	if (ddlSL.selectedIndex > 0) {
		divNewSL.style.display = "none";
	}
	else
		divNewSL.style.display = "";
}
*/

function addEventListenerEx(el, sEvent, func, bCapture) {
	var newFunc = function(e) {
		e = (e) ? e : window.event;
		if (!e.target) e.target = e.srcElement;
		if (!e.stopPropagation) e.stopPropagation = function() {this.cancelBubble = true;};
		b = func(e);
		if (b === false && e.preventDefault) {
			e.preventDefault();
		}
		return b;
	};
	if (el){
		if (el.addEventListener) {
			el.addEventListener(sEvent, newFunc, bCapture);
		} else if (el.attachEvent) {
			el.attachEvent("on" + sEvent, newFunc);
		} else {
			alert("cannot addEventListener");
		}
	}
}

function window_onload() {	
	pwDiv = window.document.getElementById('pleaseWait');
	if (pwDiv != null) {
		window.document.getElementById('pleaseWait').innerHTML = "";
		window.document.getElementById('pleaseWait').style.display = "none";	
	}	

	window.document.getElementById('<%= txtReq.ClientID %>').focus();			
	
	window.Form1.onsubmit = form_onsubmit;		
	
	var txtETADate = window.document.getElementById('<%= calETADate.InputClientID %>');
	txtETADate.onchange = getWeek;
		
	setTimeout("test()", 300);
	
	//conPointOnChange();
	//slOnChange();
	var txtShippedDate = window.document.getElementById('<%= calShippedDate.InputClientID %>');
	addEventListenerEx(txtShippedDate, "change", function() {
				DateOnchange(); //calendar-setup.js  - HandleOnchance()
			}, false);

	DafaultForEstAct();
    var cboEstAct = window.document.getElementById('ddlEstAct');			
	addEventListenerEx(cboEstAct, "change", function() {
				var txtShippedDate = window.document.getElementById('<%= calShippedDate.InputClientID %>');
				if (!(txtShippedDate.value != "") && cboEstAct.options[cboEstAct.selectedIndex].value == 'Act')
					cboEstAct.selectedIndex = 0;
			}, false);		
}


function addOption(selectbox,text,value )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;
	selectbox.options.add(optn);
}

function DateOnchange()
{
		var cboEstAct = window.document.getElementById('ddlEstAct');	
		var txtShippedDate = window.document.getElementById('<%= calShippedDate.InputClientID %>');
			if(txtShippedDate.value!= "")
			{
				try{
		    		cboEstAct.setAttribute("disabled","disabled");
    				if(cboEstAct.options.length <3)
						addOption(cboEstAct,'Act','Act');
					cboEstAct.selectedIndex = 2;
				} catch(err){}
			}
			else
			{
    			try{
    				cboEstAct.setAttribute("disabled","");
					cboEstAct.selectedIndex = 0;
						if(cboEstAct.options.length >2)
							cboEstAct.remove(2);
					}catch(err){}
			}
/*
	var txtShippedDate = window.document.getElementById('<%= calShippedDate.InputClientID %>');
	var cboEstAct = window.document.getElementById('ddlEstAct');
	if(txtShippedDate.value != "")
		cboEstAct.setAttribute("disabled","");
	else
		cboEstAct.setAttribute("disabled","disabled");
		*/
}

function DafaultForEstAct()
{
		var cboEstAct = window.document.getElementById('ddlEstAct');	
		var txtShippedDate = window.document.getElementById('<%= calShippedDate.InputClientID %>');
			if(txtShippedDate.value.trim()== "")
			{
				try{
					if(cboEstAct.options.length >2)
						cboEstAct.remove(2);
				
				}catch(err){}
				cboEstAct.setAttribute("disabled","");
			}
			else
			{
				cboEstAct.setAttribute("disabled","disabled");
				try{
    				if(cboEstAct.options.length == 3)
						{cboEstAct.selectedIndex = 2;
						}
				} catch(err){}
			}
}

function test() {
	initVarArray = getFormsElementValue();
}

function windowCloseAndRefresh() {
	isAlreadyRefresh = true;
	<% If RequestContext.Changed = True Then %>
			window.opener.btnRefresh.click();
	<% End If %>
	window.close();
}

function getWeek() { 
	var txtETADate = window.document.getElementById('<%= calETADate.InputClientID %>');
	
	var myDate = new Date(txtETADate.value);
	var myDay;
	
	if (isNaN(myDate))
		return false;
		
	myDay = myDate.getUTCDay();
	if (myDay == 0) {
		myDay = 7;
	}
	
	myDate.setDate(myDate.getDate() + (3 - myDay));
	
	var yearNumber = myDate.getUTCFullYear();

	var days = Math.floor( (myDate.getTime() - new Date(yearNumber, 0, 1, -6)) / 864e5 );
	var weekNumber = 1 + Math.floor(days/7);
	
	return weekNumber;
	
	var txtWeek = window.document.getElementById('<%= txtWeek.ClientID%>');
	txtWeek.value = weekNumber;
}

function setWeekText(text) {
	var txtWeek = window.document.getElementById('<%= txtWeek.ClientID%>');
	txtWeek.value = text;
}

function repChar(inChar, loop) {
	var returnValue = "";
	
	for (i=0; i<loop; i++)
		returnValue += inChar;
	return returnValue;
}

function REQ_onchange()
{
	isOnSubmit = true;
	var btnReqTextChange = window.document.getElementById('<%= btnReqTextChange.ClientID%>');
	btnReqTextChange.click();
	
}
		</script>
		<uc1:jscalendarsetup id="JSCalendarSetup1" runat="server"></uc1:jscalendarsetup>
	</HEAD>
	<body bottommargin="0" onbeforeunload="window_onbeforeunload()" leftmargin="0" topmargin="0"
		scroll="no" onload="return window_onload()" rightmargin="0" onunload="window_onunload()">
		<form id="Form1" method="post" runat="server">
			<div id="Navigator">Records navigator:
				<asp:literal id="ltrNavigator" runat="server" enableviewstate="true"></asp:literal>
			</div>
			<table class="FormTable" cellspacing="1" cellpadding="1" width="100%" border="0">
				<tr>
					<td align="center" colspan="2"><asp:label id="lblMessage" runat="server" cssclass="ErrorMessage">&nbsp;</asp:label></td>
				</tr>
				<tr>
					<td class="Label All" width="130">Req *</td>
					<td><asp:textbox onkeypress="KeyInputShortType(this)" id="txtReq" runat="server" columns="6" maxlength="4"></asp:textbox><asp:requiredfieldvalidator id="RequiredFieldValidator3" runat="server" errormessage="please input Req number"
							display="Dynamic" font-bold="True" controltovalidate="txtReq">!</asp:requiredfieldvalidator><asp:comparevalidator id="CompareValidator2" runat="server" errormessage="must be numeric" display="Dynamic"
							font-bold="True" controltovalidate="txtReq" type="Integer" operator="DataTypeCheck">!</asp:comparevalidator>&nbsp;
						<span class="Label All">Container Tag No *</span><asp:textbox onkeypress="NumberOnly(0)" id="txtSalesOrder" runat="server" columns="7" maxlength="6"></asp:textbox><asp:requiredfieldvalidator id="Requiredfieldvalidator1" runat="server" errormessage="please input Container Tag No"
							display="Dynamic" font-bold="True" controltovalidate="txtSalesOrder">!</asp:requiredfieldvalidator><asp:comparevalidator id="Comparevalidator3" runat="server" errormessage="must be numeric" display="Dynamic"
							font-bold="True" controltovalidate="txtSalesOrder" type="Integer" operator="DataTypeCheck">!</asp:comparevalidator>&nbsp;<span class="Label All">Order 
							date *</span>&nbsp;<uc1:datetimepicker id="calOrderDate" runat="server" enablerequiredvalidator="true" requirederrormessage="please input order date"
							requiredtext="!"></uc1:datetimepicker>
					</td>
				</tr>
				<tr>
					<td class="Label All">Bulk</td>
					<td><asp:dropdownlist id="ddlBulk" runat="server">
							<asp:listitem value="N">New</asp:listitem>
							<asp:listitem value="F">Full</asp:listitem>
							<asp:listitem value="P">Part</asp:listitem>
						</asp:dropdownlist>
					</td>
				</tr>
				<tr>
					<td class="Label All">Size</td>
					<td><asp:dropdownlist id="ddlSize" runat="server">
							<asp:listitem selected="True"></asp:listitem>
							<asp:listitem value="40'">40'</asp:listitem>
							<asp:listitem value="40'HC">40'HC</asp:listitem>
							<asp:listitem value="20'">20'</asp:listitem>
							<asp:listitem value="LCL">LCL</asp:listitem>
							<asp:listitem value="Truck">Truck</asp:listitem>
						</asp:dropdownlist>&nbsp; <span class="Label All">Pack</span>
						<asp:dropdownlist id="ddlPack" runat="server">
							<asp:listitem selected="True"></asp:listitem>
							<asp:listitem value="H">HD Pallet</asp:listitem>
							<asp:listitem value="T">TS Pallet</asp:listitem>
							<asp:listitem value="P">TD Pallet</asp:listitem>
							<asp:listitem value="D">SD Pallet</asp:listitem>
							<asp:listitem value="C">HC Crate</asp:listitem>
							<asp:listitem value="L">Loose</asp:listitem>
							<asp:listitem value="M">Mixed</asp:listitem>
							<asp:listitem value="S">Samples</asp:listitem>
						</asp:dropdownlist>&nbsp; <span class="Label All">Type *</span>&nbsp;
						<asp:dropdownlist id="ddlType" runat="server">
							<asp:listitem value="0">[--select--]</asp:listitem>
							<asp:listitem value="W">Warehouse</asp:listitem>
							<asp:listitem value="D">Direct FOB</asp:listitem>
							<asp:listitem value="H">Direct HD</asp:listitem>
						</asp:dropdownlist><asp:requiredfieldvalidator id="Requiredfieldvalidator4" runat="server" errormessage="please select order type"
							display="Dynamic" font-bold="True" controltovalidate="ddlType" initialvalue="0">!</asp:requiredfieldvalidator></td>
				</tr>
				<tr>
					<td class="Label  All">Supplier *</td>
					<td><asp:dropdownlist id="ddlSupplier" runat="server" onchange="combineSuppOrder()"></asp:dropdownlist><asp:requiredfieldvalidator id="Requiredfieldvalidator5" runat="server" errormessage="please input Supplier number"
							display="Dynamic" font-bold="True" controltovalidate="ddlSupplier" initialvalue="-1">!</asp:requiredfieldvalidator>&nbsp;
						<span class="Label All">Order no *</span>
						<asp:textbox onkeypress="KeyInputShortType(this)" id="txtOrderNo" runat="server" columns="5"
							maxlength="3" onchange="combineSuppOrder()"></asp:textbox><asp:comparevalidator id="Comparevalidator4" runat="server" errormessage="must be numeric" display="Dynamic"
							font-bold="True" controltovalidate="txtOrderNo" type="Integer" operator="DataTypeCheck">!</asp:comparevalidator><asp:requiredfieldvalidator id="RequiredFieldValidator2" runat="server" errormessage="please input order number"
							display="Dynamic" font-bold="True" controltovalidate="txtOrderNo">!</asp:requiredfieldvalidator>&nbsp;&nbsp;
					</td>
				</tr>
				<tr>
					<td class="Label All">Primary</td>
					<td><asp:dropdownlist id="ddlPrimary" runat="server">
							<asp:listitem selected="True"></asp:listitem>
							<asp:listitem value="P">Primary</asp:listitem>
							<asp:listitem value="S">Secondary</asp:listitem>
							<asp:listitem value="T">Combined</asp:listitem>
							<asp:listitem value="U">B Combined</asp:listitem>
						</asp:dropdownlist>&nbsp;<span class="Label All">Consolidation</span><asp:textbox onkeypress="KeyInputShortType(this)" id="txtCon" runat="server" columns="3" maxlength="1"></asp:textbox><asp:comparevalidator id="Comparevalidator5" runat="server" errormessage="must be numeric" display="Dynamic"
							font-bold="True" controltovalidate="txtCon" type="Integer" operator="DataTypeCheck">!</asp:comparevalidator></td>
				</tr>
				<tr>
					<td class="Label Officer">Responsible</td>
					<td>
						<table class="FormTable" cellspacing="0" cellpadding="0" border="0">
							<tr>
								<td><span id="divResponsible"><i>[no responsible available]</i></span></td>
								<td><span class="Label Officer">PO In Opera</span></td>
								<td><uc1:datetimepicker id="calPOInOpera" runat="server" enablerequiredvalidator="false" requiredtext="!"></uc1:datetimepicker></td>
							</tr>
						</table>
					</td>
					</TD>
				</tr>
				<tr>
					<td class="Label  Officer">
						PI/SC</td>
					<td>
						<asp:textbox id="txtPISC" runat="server" maxlength="12" columns="20"></asp:textbox>&nbsp;<span class="Label Officer">Account 
							no</span>
						<asp:textbox id="txtAccNo" runat="server" maxlength="7" columns="9"></asp:textbox></td>
				</tr>
				<tr>
					<td class="Label Officer">Customer</td>
					<td><asp:textbox id="txtCustomer" runat="server" columns="45" maxlength="30"></asp:textbox>&nbsp;<span class="Label Officer">Customer 
							PO No</span>
						<asp:textbox id="txtCustPONo" runat="server" columns="17" maxlength="12"></asp:textbox></td>
				</tr>
				<tr>
					<td class="Label Officer">Final Destination</td>
					<td><asp:textbox id="txtFinalDestination" runat="server" columns="45" maxlength="30"></asp:textbox></td>
				</tr>
				<tr>
					<td class="Label Officer">Arrival Port</td>
					<td><asp:textbox id="txtArrivalPort" runat="server" columns="45" maxlength="30"></asp:textbox></td>
				</tr>
				<tr>
					<td class="Label  All">Description</td>
					<td><asp:textbox id="txtDescription" runat="server" columns="85" maxlength="50"></asp:textbox></td>
				</tr>
				<tr>
					<td class="Label Supplier">Factory ETD</td>
					<td nowrap>
						<table class="FormTable" cellspacing="0" cellpadding="0" border="0">
							<tr>
								<td style="WIDTH: 158px"><uc1:datetimepicker id="calFactoryETD" runat="server" enablerequiredvalidator="false" requiredtext="!"></uc1:datetimepicker></td>
								<td class="Label All">Target ETD&nbsp;</td>
								<td><uc1:datetimepicker id="calTargetETD" runat="server" enablerequiredvalidator="false" requiredtext="!"></uc1:datetimepicker></td>
								<td>&nbsp;&nbsp;&nbsp;</td>
								<td class="Label Supplier"><asp:checkbox id="chkOnHold" runat="server"></asp:checkbox></td>
								<td class="Label Supplier">&nbsp;&nbsp;On Hold&nbsp;</td>
							</tr>
						</table>
					</td>
				</tr>
				<TR>
					<TD class="Label Supplier">Shipped Date</TD>
					<TD noWrap>
						<table class="FormTable" cellspacing="0" cellpadding="0" border="0">
							<tr>
								<td>
									<uc1:datetimepicker id="calShippedDate" runat="server" enablerequiredvalidator="false" requiredtext="!"></uc1:datetimepicker>
								</td>
								<td class="Label Supplier">&nbsp; Nom Ship&nbsp;</td>
								<td>
									<asp:dropdownlist id="ddlNomShip" style="FLOAT: left" runat="server">
										<asp:ListItem Selected="True" Value="No">No</asp:ListItem>
										<asp:ListItem Value="Yes">Yes</asp:ListItem>
										<asp:ListItem Value="Done">Done</asp:ListItem>
									</asp:dropdownlist>
								</td>
								<td class="Label Supplier">&nbsp; Est/Act&nbsp;
								</td>
								<td>
									<asp:dropdownlist id="ddlEstAct" style="FLOAT: left" runat="server">
										<asp:ListItem Selected="True" Value="">Blank</asp:ListItem>
										<asp:ListItem Value="Est">Est</asp:ListItem>
										<asp:ListItem Value="Act">Act</asp:ListItem>
									</asp:dropdownlist>
								</td>
							</tr>
						</table>
					</TD>
				</TR>
				<tr>
					<td class="Label Supplier">Shipping Line</td>
					<td>
						<asp:dropdownlist id="ddlSL" runat="server" style="FLOAT:left"></asp:dropdownlist>
					</td>
				</tr>
				<TR>
					<TD class="Label Supplier">Feeder Vessel</TD>
					<TD>
						<asp:textbox id="txtFeederVessel" runat="server" maxlength="30" columns="45"></asp:textbox></TD>
				</TR>
				<tr>
					<td class="Label Supplier">Mother Vessel</td>
					<td><asp:textbox id="txtVessel" runat="server" columns="45" maxlength="30"></asp:textbox>&nbsp;
						<span class="Label Supplier">Container No</span>&nbsp;<asp:textbox id="txtContainerNo" runat="server" columns="20" maxlength="16"></asp:textbox></td>
				</tr>
				<tr>
					<td class="Label Supplier">ETA Date</td>
					<td>
						<table class="FormTable" cellspacing="0" cellpadding="0" border="0">
							<tr>
								<td><uc1:datetimepicker id="calETADate" runat="server" enablerequiredvalidator="false" requiredtext="!"></uc1:datetimepicker></td>
								<td>&nbsp; <span class="Label Supplier">Week</span>&nbsp;</td>
								<td><asp:textbox id="txtWeek" runat="server" columns="2" readonly="True" enabled="False"></asp:textbox></td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td class="Label Officer">Container Delivered
					</td>
					<td><uc1:datetimepicker id="calConDel" runat="server" enablerequiredvalidator="false" requiredtext="!"></uc1:datetimepicker></td>
				</tr>
				<% if MIMS_WRS.Web.Security.IsAdmin then %>
				<tr>
					<td class="Label Officer"><span class="Label Officer">Pay Auth</span></td>
					<td><asp:dropdownlist id="ddlPayAuth" runat="server">
							<asp:listitem selected="True"></asp:listitem>
							<asp:listitem value="MM">MM</asp:listitem>
							<asp:listitem value="AC">AC</asp:listitem>
							<asp:listitem value="AM">AM</asp:listitem>
						</asp:dropdownlist></td>
				</tr>
				<% end if %>
				<tr>
					<td class="Label Officer"><span class="Label Officer">P Payment</span></td>
					<td>
						<asp:dropdownlist id="ddlPayment" runat="server">
							<asp:listitem selected="True"></asp:listitem>
							<asp:listitem value="D">Deposit Paid</asp:listitem>
							<asp:listitem value="F">Full Paid</asp:listitem>
							<asp:listitem value="R">L/C Raised</asp:listitem>
							<asp:listitem value="P">L/C Paid</asp:listitem>
							<asp:listitem value="C">Credit</asp:listitem>
						</asp:dropdownlist>
					</td>
				</tr>
				<tr>
					<td class="Label Officer"><span class="Label Officer">P Dep Value</span></td>
					<td>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtPDepValue" runat="server" columns="12" maxlength="8"></asp:textbox><asp:comparevalidator id="Comparevalidator1" runat="server" errormessage="invalid P Dep Value number format"
							display="Dynamic" font-bold="True" controltovalidate="txtPDepValue" type="Currency" operator="DataTypeCheck">!</asp:comparevalidator>
					</td>
				</tr>
				<tr>
					<td class="Label Officer"><span class="Label Officer">P Inv Value</span></td>
					<td>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtInvValue" runat="server" columns="12" maxlength="8"></asp:textbox><asp:comparevalidator id="CompareValidator6" runat="server" errormessage="invalid Inv Value number format"
							display="Dynamic" font-bold="True" controltovalidate="txtInvValue" type="Currency" operator="DataTypeCheck">!</asp:comparevalidator>&nbsp;
						<span class="Label Officer">P Pay Date</span><uc1:datetimepicker id="calPPayDate" runat="server" enablerequiredvalidator="false" requiredtext="!"></uc1:datetimepicker></td>
				</tr>
				<tr>
					<td class="Label Officer">Doc Received</td>
					<td><asp:checkbox id="chkDocRec" runat="server" text="Yes"></asp:checkbox></td>
				</tr>
				<tr>
					<td class="Label Officer">Completed Date</td>
					<td><uc1:datetimepicker id="calCompletedDate" runat="server" enablerequiredvalidator="false" requiredtext="!"></uc1:datetimepicker></td>
				</tr>
				<tr>
					<td class="Label Officer">Sales Invoice No</td>
					<td><asp:textbox onkeypress="NumberOnly(0)" id="txtSInvoiced" runat="server" columns="7" maxlength="5"></asp:textbox>
						<asp:comparevalidator id="Comparevalidator7" runat="server" errormessage="invalid Sales Invoice number format"
							display="Dynamic" font-bold="True" controltovalidate="txtSInvoiced" type="Integer" operator="DataTypeCheck">!</asp:comparevalidator>
						&nbsp;<span class="Label Officer">Sales Invoice Value</span><asp:textbox onkeypress="NumberOnly(1)" id="txtSalesInvoiceValue" runat="server" columns="12"
							maxlength="10"></asp:textbox>
						<asp:comparevalidator id="Comparevalidator8" runat="server" errormessage="invalid Sales Invoice value format, must be xxxxxx.yy"
							display="Dynamic" font-bold="True" controltovalidate="txtSalesInvoiceValue" type="Double" operator="DataTypeCheck">!</asp:comparevalidator>
						&nbsp;<span class="Label Officer">Sales Invoice Date</span><uc1:datetimepicker id="calSalesInvoiceDate" runat="server" requiredtext="!" enablerequiredvalidator="false"></uc1:datetimepicker>
					</td>
				</tr>
				<tr>
					<td class="Label Officer">Sales Payment Due</td>
					<td><uc1:datetimepicker id="calSalesPaymentDue" runat="server" requiredtext="!" enablerequiredvalidator="false"></uc1:datetimepicker>&nbsp;<span class="Label Officer">Sales 
							Invoice Paid</span><uc1:datetimepicker id="calSInvoicedPd" runat="server" requiredtext="!" enablerequiredvalidator="false"></uc1:datetimepicker><span class="Label Officer">Lead 
							Days</span><asp:TextBox ID="txtLeadDays" Runat="server" ReadOnly="True" size="4"></asp:TextBox>
					</td>
				</tr>
				<tr>
					<td class="Label All">Supplier Order No</td>
					<td><asp:label id="lblSuppOrderNo" runat="server"></asp:label></td>
				</tr>
				<tr>
					<td class="Label All"></td>
					<td><asp:CheckBox ID="chkArchived" Runat="server" Text="Is Archived"></asp:CheckBox></td>
				</tr>
				<tr>
					<td class="Label Officer" height="50"></td>
					<td height="40"><asp:button id="btnSubmit" runat="server" text="Submit"></asp:button>&nbsp;<input onclick="windowCloseAndRefresh();" type="button" value="Cancel"><asp:button id="btnReqTextChange" runat="server" text="" CausesValidation="False" Width="0"></asp:button></td>
				</tr>
			</table>
			<div class="Legend">Field Indicators:&nbsp;<span class="All">All</span>&nbsp;&nbsp;<span class="Officer">Office</span>&nbsp;&nbsp;<span class="Supplier">Factory</span>
				<br>
				<span class="Required">*</span> denotes a required field</div>
			<asp:validationsummary id="ValidationSummary1" runat="server" showmessagebox="True" showsummary="False"></asp:validationsummary></form>
		<input type="hidden" runat="server" id="hidResponsibleHTML">
		<script language="javascript">
			var divResponsible = document.getElementById('divResponsible');
			var ddlSupp = document.getElementById('<%= ddlSupplier.ClientID %>');
			
			
			function callback(res) {
				
				if (res.value) {
					divResponsible.innerHTML = res.value;			
				}
				else
					divResponsible.innerHTML = "<i>[no responsible available]</i>";
			}
			
			function combineSuppOrder() {
				var lblSuppOrder = window.document.getElementById('<%= lblSuppOrderNo.ClientID%>');				
				var txtOrderNo = window.document.getElementById('<%= txtOrderNo.ClientID%>');
				if (ddlSupp.selectedIndex > 0) {
					lblSuppOrder.innerHTML = ddlSupp.options[ddlSupp.selectedIndex].value + repChar('0', 3-txtOrderNo.value.length) + txtOrderNo.value;
				} else {
					lblSuppOrder.innerHTML = "N/A";
				}
				
				divResponsible.innerHTML = "<i>[loading responsible...]</i>";
				MIMS_WRS.Web.AjaxUtilMethod.GetResponsibleHTML(ddlSupp.options[ddlSupp.selectedIndex].value, '<%= RequestContext.OfficeID %>', callback);	
			}
			
			if (ddlSupp.selectedIndex > 0) {
				var hidResponsibleHTML = window.document.getElementById('<%= hidResponsibleHTML.ClientID %>');								
				divResponsible.innerHTML = hidResponsibleHTML.value;
			}
		
		</script>
	</body>
</HTML>
